//
//  LTHistroyRadioTableViewCell.m
//  聆听FM
//
//  Created by dllo on 16/6/20.
//  Copyright © 2016年 Dark. All rights reserved.
//

#import "LTHistroyRadioTableViewCell.h"

@implementation LTHistroyRadioTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.listImage.transform = CGAffineTransformRotate(self.listImage.transform, M_PI_2);
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didListImage)];
    [self.listImage addGestureRecognizer:tap];
}

- (void)didListImage
{
    [self.delegate pushRadio:self.model];
}
- (void)setModel:(LJLRadioPageModel *)model
{
    if (_model != model) {
        _model = model;
        [self.leftImageView sd_setImageWithURL:[NSURL URLWithString:model.radioCoverLarge] placeholderImage:[UIImage sd_animatedGIFNamed:@"占位图"]];
        self.titleLabel.text = model.rname;
        if (model.radioPlayCount >= 10000) {
            self.numberLabel.text = [NSString stringWithFormat:@"%.1f万人收听", model.radioPlayCount / 10000.0];
        }
        else
        {
        self.numberLabel.text = [NSString stringWithFormat:@"%ld人收听", model.radioPlayCount];
        }
        
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
